home *** CD-ROM | disk | FTP | other *** search
- // This example demonstrates the process of XOR encryption and decription.
- // Symbol "a" - source, symbol "3"- key
- // "a" XOR "3" = "R" i.e. "R" - encrypted "a" with XOR key "3"
- // For decryption we do:
- // "R" XOR "3" = "a"
- //
- // a XOR 3 =R
- WScript.echo("a ^ 3 ="+String.fromCharCode( "a".charCodeAt(0) ^ "3".charCodeAt(0)));
- // R XOR 3 =a
- WScript.echo("R ^ 3 ="+String.fromCharCode( "R".charCodeAt(0) ^ "3".charCodeAt(0)));
-